import { post, postForm, get } from '../request'

const prefix = '/ytdzdt-server'

/*
 * 登录
*/
export function login(option) {
  return post(prefix + '/sso/login', option)
}

/*
 * 登出
*/
export function loginOut(option) {
  return post(prefix + '/sso/logout', option)
}

//用户登录鉴权
export function loginApi(option) {
  return post(prefix + '/UserDomain/AuthService/validatePassword/v1', option)
}

//获取登录用户角色
export function getUserInfoApi() {
  return post(prefix + '/UserDomain/RoleService/getRoleInfo/v1')
}
//获取最新的apk二维码
export function getApkCode() {
  return postForm(prefix + '/SystemDomain/AppPublishService/getApkCode/v1', null, {
    responseType: 'blob'
  })
}

//获取用户资源权限列表
export function getResourceListApi() {
  return post(prefix + '/ResourceService/getResourceList/v1')
}

// 根据key值获取系统配置
export function SysConfigService(data) {
  return postForm(prefix + '/SystemDomain/SysConfigService/getByKey/v1', data)
}
// 根据key值获取系统配置
export function getBaseUrl() {
  return get('/webstore-server/config/dictionary/dic?key=DIC_Baselayer')
  // return get('/adf-gis-server/config/dictionary/dic?key=DIC_Baselayer')
}

